/*
 * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package io.iec.edp.caf.tenancy.api.service;

import io.iec.edp.caf.tenancy.api.entity.Tenant;


import java.util.List;


public interface TenantPersistenceService {
    /**
     * 根据租户标识获取详细信息
     *
     * @param tenantId 租户标识
     * @param language 语种编号
     * @return
     * @Date: 2019/8/22
     */
    public Tenant get(int tenantId, String language);

    public void saveTenant(Tenant tenant);

    public void deleteTenantById(Integer tenantId);
    /**
     * 根据租户标识获取详细信息
     *
     * @param language 语种编号
     * @return
     * @Date: 2019/8/22
     */
    public List<Tenant> getAllTenants(String language);

    /// <summary>
    /// 根据租户编号获取详细信息
    /// </summary>
    /// <param name="tenantCode">租户编号</param>
    /// <returns>租户信息</returns>
    public Tenant getByCode(String tenantCode, String language);

    /**
     * 更新租户信息
     *
     * @param tenant 租户
     * @param language 语种编号
     * @return
     * @Date: 2019/8/22
     */
    public void add(Tenant tenant,String language);

    /**
     * 删除租户信息
     *
     * @param id 租户Id
     * @return
     * @Date: 2019/8/22
     */
    public boolean remove(int id);

    public void updateTenant(Tenant tenant,int oldTenantId);
}
